package com.runfast.paotui.service;

import com.runfast.common.service.IService;
import com.runfast.common.web.entity.Result;
import com.runfast.paotui.dao.model.Order;
import com.runfast.paotui.dao.model.OrderExample;
import com.runfast.paotui.web.dto.OrderDto;
import com.runfast.waimai.dao.model.RunfastGoodsSellRecord;
import com.runfast.waimai.util.PageBean;
import org.apache.ibatis.annotations.Param;

import java.lang.reflect.InvocationTargetException;
import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderService extends IService<Order, Integer, OrderExample> {
    Integer findByShopperidAndStatusAndbookTimecount(Integer shopperid,Integer status,Date date );
    List<Order> findByShopperidAndStatusAndbookTime( Integer shopperid,Integer status,Date date );

     List<Order> findBookTime(Integer id, Date dt1,Integer agentid) ;
    Integer  findBookTimecount(Integer id, Date dt1,Integer agentid);


    List<Order> findByShopperidAndSize(Integer id) ;
 List<Order> findByShopperid(Integer id) ;
 PageBean<Order> getPageBean4Driver(Integer pageSize, Integer page, Integer status, Integer shopperId, Integer agentid, Integer teamid);

 List<Order>  findByShopperidAndStatus(Integer driverId, Integer status,Integer page,Integer pagesize);
    Order findByUseridAndCode(Integer userid ,String orderNo);
    Order findByShopperidAndCode(Integer shopperid,Integer id);
    Order get(Integer id);
    Result confirm(Order order);

    Result take(Integer driverId, Integer orderId);

    Result cancel(Integer userId, Integer orderId);

    List<Map<String, Integer>> selectIdUserIdByExample(OrderExample example);

    Result fillIn(Order order);

    OrderDto toOrderDto(Order order) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException;

 void updateStatusAndTime(Order orderuser2);

    List<Map<String,Object>> findAgentIdAndStatus(Integer agentId, Integer status,Integer page,Integer pagesize);
    List<Order> findAgentIdAndStatus1(Integer agentId, Integer status,Integer page,Integer pagesize);

    Integer findAgentIdAndStatuscount(Integer agentId, Integer i, Integer page1, Integer pagesize);

    Integer findByShopperidAndStatuscount(Integer id, int i);

    Order findbyid(Integer id);

    List<Order> findAllAndTime(Integer id,Integer page, Integer pagesize, Date time1, Date time2);
    Integer  findAllAndTimecount(Integer id,Integer page, Integer pagesize, Date time1, Date time2);

    Integer findByShopperidAndStatuscount3(Integer shopperid, Integer status);

    List<Order> findByShopperidAndStatusSize(Integer shopperid);

    List<Order> findShopperAndStatusErro(Integer shopperid);

    Integer findByShopperidAndStatuscount4(Integer shopperid);

    List<Map<String,String>> findcommisson(Integer shopperid, Date date1, Date date2);
}